<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath %>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- BOOTSTRAP STYLES-->
    <link href="css/bootstrap.css" rel="stylesheet" />
    <!-- FONTAWESOME STYLES-->
    <link href="css/font-awesome.css" rel="stylesheet" />
       <!--CUSTOM BASIC STYLES-->
    <link href="css/basic.css" rel="stylesheet" />
    <!--CUSTOM MAIN STYLES-->
    <link href="css/custom.css" rel="stylesheet" />
    <!-- GOOGLE FONTS-->
    <link href='http://fonts.useso.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
		<title></title>
		 <script src="http://code.jquery.com/jquery-1.11.0-beta1.js"></script>
	</head>
	<body>
	<script type="text/javascript">
	$(function(){
		$('input.delete').click(function(){
			var value=$(this).parent('td').parent('tr').find('td').eq(0).html();
			if (confirm("是否删除？")) {
				window.location.href="reviewDele.do?c_reviewid="+value; 
			} else {
				alert("删除失败！");
			}

		})
		})
	</script>
		 <div class="container-fluid">
			<div class="row">
				<div class="col-md-12">
					<h1 class="page-header">
                                          评论管理 <small> 评论列表</small>
                    </h1>     
				</div>
			</div>
			<div class="row">
				<div class=" col-md-12 ">
					<!-- 商品列表--bootstrap高级表格使用 -->
					<div class="panel panel-default">
						<div class="panel-heading">
							评论列表
						</div>
						<div class="panel-body">
							<!--table-responsive响应式表格，会自动添加滚动条-->
							<form action="review.do">
							<div>							
								            <select name="Reviewclassid" id="Reviewclassid">
                                          <option value="">请选择...</option>
                                            <c:forEach items="${reviewclass }" var="reviewclass">
                                            <option value="${reviewclass.reviewclassid }">${reviewclass.reviewclassname }</option>
                                               </c:forEach>
                                           </select>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                          	
								菜品名称：<input id="DishName" name="DishName" type="text"/>
								<input type="submit" value="搜索"/>
								</form>
							</div>
							<br />
						
							<div class="table-responsive">
								<table class="table table-striped table-bordered table-hover" id="review_manage">
                                    <thead>
                                        <tr>                         
                                            <th>评论编号</th>
                                            <th>菜品名称</th>
                                            <th>评论类型</th>
                                            <th>评论内容</th>
                                            <th>回复时间</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${review}" var="review">
                                       <tr>                                   
                                       <td name='c_reviewid'>${review.c_reviewid}</td>
                                       <td name='dishName'>${review.dishName}</td>
                                       <td name='c_reviewclassname'>${review.reviewclassname}</td>
                                       <td name='c_content'>${review.content}</td>
                                       <td name='c_rtime'>${review.rdate} ${review.rtime}</td>
                                       <td> <input type="button" name="delete" value="删除" class="delete" style="border:0px"/>                             
                                            </td>   
                                       </tr>
                                       </c:forEach>
								</table>
							</div>					
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>